<?php
	$username=$_POST['username'];
	$userpass=$_POST['userpass'];
	//mysqli 预编译
	$mysqliobj=new mysqli('localhost','root','dx123','mysqli');
	//创建预编译对象
	$sql="select id from userstb where name=? and password=?";
	$myState=$mysqliobj->prepare($sql);
	//填入数据(类型 顺序必须对应)
	$myState->bind_param("ss",$username,$userpass);
	//绑定结果集
	$myState->bind_result($id);
	//执行
	$b=$myState->execute();
	if($myState->fetch())
	{
		echo "true";
	}
	else
	{
		echo "false";
	}
?>